*------------------------------------------------------------------------------*
		*** FIGURE S15. SIMULATION OF PREDICTED CHANGE IN VOTE SHARE, CLOSE ELECTIONS ***
*------------------------------------------------------------------------------*

set graphics on



use "${tempdata}kreise_elections_collapsed.dta", clear
drop if strpos(electionname, "Hamburg")
drop if strpos(electionname, "Berlin")
drop if strpos(electionname, "Bremen")

keep if inrange(incumbent_final, 45, 55)
gen diff=incumbent_final-share_woPM_IV1_seats

gsort -diff

gen electiongroup1 = _n
labmask electiongroup1, values(electionname)

local N=_N
twoway (rspike incumbent_final share_woPM_IV1_seats electiongroup1, horizontal lcolor(blue)) ///
	(scatter electiongroup1 incumbent_final, mcolor(blue) msymbol(circle)) ///
	(scatter electiongroup1 share_woPM_IV1_seats, mcolor(red) msymbol(circle)), ///
	scheme(burd5) ///
	ylabel(1(1)`N', valuelabel angle(horizontal) labsize(2.5)) ///
	xline(50) ///
	ytitle("") ///
	yscale(reverse) ///
	xtitle("Predicted" "Incumbent Share") ///
	graphregion(color(white)) bgcolor(white) ///
	name(graph2, replace) ///
	legend(order(2 "Actual PM10" 3 "Average PM10") pos(11) row(1)) 

graph export "${outputs}figure_S15.png", as(png) replace


clear

exit
